﻿using System;
using System.Collections.Generic;

namespace LabNet.Server.Domain
{
    public class User
    {
        public long Id { get; set; }
        public string FirstName { get; set; }
        public string LastName { get; set; }

        public string Name
        {
            get { return String.Format("{0} {1}", LastName, FirstName); }
        }
        public string UserName { get; set; }
        public string Paswword { get; set; }
        public string Email { get; set; }
        public bool IsActive { get; set; }
        public bool IsAdministator { get; set; }
        public DateTime? Created { get; set; }
        public DateTime? Updated { get; set; }
        public bool IsRemoved { get; set; }
        public long Creator { get; set; }
        public long Updater { get; set; }

        public bool Transient()
        {
            return Id.Equals(default(long));
        }

        public virtual ICollection<UserLogin> Logins { get; set; }
        public virtual ICollection<UserClaim> Claims { get; set; }
        public virtual ICollection<UserRole> Roles { get; set; }
        public virtual ICollection<UserGroup> Groups { get; set; }
    }
}

